package com.usian.admin.feign;

import com.usian.model.article.ApArticle;
import com.usian.model.article.ApArticleConfig;
import com.usian.model.article.ApArticleContent;
import com.usian.model.article.ApAuthor;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

@FeignClient(value = "leadnews-article")
public interface ArticleFeign {

    //1.保存文章信息
    @PostMapping("/api/v1/article/save")
    ApArticle saveArticle(ApArticle apArticle);

    //2.保存文章内容
    @PostMapping("/api/v1/article_content/save")
    ResponseResult saveArticleContent(ApArticleContent apArticleContent);

    //3.保存文章配置内容
    @PostMapping("/api/v1/article_config/save")
    ResponseResult saveArticleConfig(ApArticleConfig apArticleConfig);

    //4.根据用户名称查询作者信息
    @GetMapping("/api/v1/author/findByName/{name}")
    ApAuthor selectAuthorByName(@PathVariable("name") String name);
}
